/******************************************************************************
 * FileName:    gwin_remote.h
 * Desc:        遥控
 *
 *
 * Author:      Lin
 * Notes:
 *
 ******************************************************************************/

#ifndef _GWIN_REMOTE_H_
#define _GWIN_REMOTE_H_


/*-------------------------- Includes ---------------------------------------*/
#include "gwin_global_config.h"


/*-------------------------- Macro Definitions ------------------------------*/

/*-------------------------- Type Declarations ------------------------------*/
/**
 * @brief 广播包内容单元
 */
typedef struct
{
    uint8_t len;
    uint8_t type;
    uint8_t data[1];
}adv_payload_unit_t;
#define ADV_PAYLOAD_UNIT_LEN_MIN            ( 2 )           // 广播包内容单元格式中长度的最小值
#define ADV_PAYLOAD_UNIT_LEN_MAX            ( 29 )          // 广播包内容单元格式中长度的最大值

/**
 * @brief 多协议解析处理表
 */
typedef struct
{
    int8_t (*gwin_remote_date_check_func)(uint8_t *data, uint16_t len, remote_pair_info_t *remote_pair_info, uint8_t *adv_payload_pos, uint8_t *cmd_index);
    void (*gwin_remote_date_proc_func)(uint8_t *data, uint16_t len, remote_pair_info_t *remote_pair_info, uint8_t *_action, uint32_t *_param);
}gwin_remote_date_proc_map_t;


/*-------------------------- Global Variables -------------------------------*/

/*-------------------------- Local Variables --------------------------------*/

/*-------------------------- Functions Declarations -------------------------*/

/*-------------------------- Functions Definitions --------------------------*/
void gwin_remote_scan_start(void);
void gwin_remote_date_recv(uint8_t *data, uint16_t len);
void gwin_remote_task(void);


#endif // _GWIN_REMOTE_H_


/*-------------------------- END OF FILE ------------------------------------*/

